package _021_11_20

func maxProfit(prices []int) int {
	maxFit := 0

	for i := 0; i < len(prices); i++ {

		for j := 1; j < len(prices); j++ {
			if prices[j]-prices[i] > maxFit {
				maxFit = prices[j] - prices[i]
			}
		}
	}

	return maxFit
}
